CSharpTest.Net
PasswordKey Constructor(Boolean,Byte[])
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace > PasswordKey Class > PasswordKey Constructor : PasswordKey Constructor(Boolean,Byte[])

clear
bytes

Glossary Item Box

Creates the password from the given password bytes

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal clear As Boolean, _
   ByVal bytes() As Byte _
)
C# 
public PasswordKey( 
   bool clear,
   byte[] bytes
)

Parameters

clear
bytes

Example

Library/Library.Test/TestPassword.cs

C#Copy Code
byte[] password = Encoding.UTF8.GetBytes(TEST_PASSWORD);
PasswordKey pk1 = new PasswordKey(true, password);
Assert.AreEqual(new byte[password.Length], password);

password = Encoding.UTF8.GetBytes(TEST_PASSWORD);
pk1 = new PasswordKey(false, password);
Assert.AreEqual(Encoding.UTF8.GetBytes(TEST_PASSWORD), password);
VB.NETCopy Code
Dim password As Byte() = Encoding.UTF8.GetBytes(TEST_PASSWORD)
Dim pk1 As New PasswordKey(True, password)
Assert.AreEqual(New Byte(password.Length) {}, password)

password = Encoding.UTF8.GetBytes(TEST_PASSWORD)
pk1 = New PasswordKey(False, password)
Assert.AreEqual(Encoding.UTF8.GetBytes(TEST_PASSWORD), password)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys